#include <stdio.h>
void transposeMatrix(int (*matrix)[3], int (*result)[3]);
int main() {
    int matrix[3][3] = {
        {1, 2, 3},
        {4, 5, 6},
        {7, 8, 9}
    };
    int result[3][3];
    transposeMatrix(matrix, result);
    printf("转置后的矩阵:\n");
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            printf("%d ", result[i][j]);
        }
        printf("\n");
    }

    return 0;
}
void transposeMatrix(int (*matrix)[3], int (*result)[3]) {
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) 
        {
            *(*(result + i) + j) = *(*(matrix + j) + i);
        }
    }
}